package com.mifengkong.cygtools.model;

import com.mifengkong.cygtools.jjcard.BaseResponseForCard;
import com.mifengkong.cygtools.jjcard.CardMainBean;
import com.mifengkong.cygtools.jjcard.CashByCreditCardBean;
import com.mifengkong.cygtools.jjcard.H5AutoFillDataBean;
import com.mifengkong.cygtools.jjcard.UserInfo;
import com.mifengkong.frtools.http.request.BaseResponse;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

/**
 * Created by jack on 2018/1/23
 */

public interface TestApi {

    @FormUrlEncoded
    @POST("Additional/getCustomerPhone")
    Observable<BaseResponse<String>> getCustomerServiceTel(@FieldMap Map<String, Object> params);//获取客服电话

    @FormUrlEncoded
    @POST("Cash/insertUser")
    Observable<BaseResponse<String>> insertUser(@FieldMap Map<String, Object> params);    //插入用户信息


    @Multipart
    @POST("user/uploadImage")
    Observable<BaseResponse<String>> sendUserAvator(@Part MultipartBody.Part file); //上传用户头像

    @GET("card/list")
    Observable<BaseResponseForCard<CardMainBean>> getCardsData();//获取首页的列表数据

    @FormUrlEncoded
    @POST("message/read")
    Observable<BaseResponse<String>> setMessageRead(@FieldMap Map<String, Object> map); //设置消息为已读


    @FormUrlEncoded
    @POST("user/phoneLogin")
    Observable<BaseResponseForCard<UserInfo>> getLoginInfo(@FieldMap Map<String, Object> map);//手机号登录

    @FormUrlEncoded
    @POST("Product/autoFillData")
    Observable<BaseResponseForCard<List<H5AutoFillDataBean>>> getAutoFillData(@FieldMap Map<String, Object> map);//手机号登录

    @FormUrlEncoded
    @POST("Cash/getDefaultCreditCard")
    Observable<BaseResponse<CashByCreditCardBean>> getDefaultCreditCard(@FieldMap Map<String, Object> params);//获得用户默认信用卡
}
